-
Notifications
You must be signed in to change notification settings - Fork 529
Fix hasOffsetValueType with object #4272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
2e36453
to
e5c5399
Compare
@ondrejmirtes you reported in #4164
The reason was the fact that I tried to fix this, but now I'm getting the a LegacyNodeScope test failure because
is now understood as an error and not mixed ; it's related to phpstan-src/src/PhpDoc/TypeNodeResolver.php Line 1230 in 5a39902
Does the change seems ok to you ? If not any idea how I should fix it ? |
What I don't get currently is why
is considered as mixed by PHPStan, and why
is considered as Changing this might be a correct way to finish this PR ; I'm open to any advice ondrej. |
The behavior for So I had to update the test. |
This pull request has been marked as ready for review. |
@@ -1801,7 +1801,7 @@ public static function dataProperties(): array | |||
'$this->resource', | |||
], | |||
[ | |||
'mixed', | |||
'*ERROR*', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Phpdoc use array[array]
Thank you! |
Cf https://www.php.net/manual/en/language.types.array.php
Arrays and objects can not be used as keys. Doing so will result in a warning: Illegal offset type.
So ObjectType::toArrayKey should be an error.